package com.panda.order.service.impl;

import java.util.List;
import com.panda.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.panda.order.mapper.TPandaOrderLineMapper;
import com.panda.order.domain.TPandaOrderLine;
import com.panda.order.service.ITPandaOrderLineService;

/**
 * 子订单明细Service业务层处理
 * 
 * @author panda
 * @date 2021-03-14
 */
@Service
public class TPandaOrderLineServiceImpl implements ITPandaOrderLineService 
{
    @Autowired
    private TPandaOrderLineMapper tPandaOrderLineMapper;

    /**
     * 查询子订单明细
     * 
     * @param id 子订单明细ID
     * @return 子订单明细
     */
    @Override
    public TPandaOrderLine selectTPandaOrderLineById(Long id)
    {
        return tPandaOrderLineMapper.selectTPandaOrderLineById(id);
    }

    /**
     * 查询子订单明细列表
     * 
     * @param tPandaOrderLine 子订单明细
     * @return 子订单明细
     */
    @Override
    public List<TPandaOrderLine> selectTPandaOrderLineList(TPandaOrderLine tPandaOrderLine)
    {
        return tPandaOrderLineMapper.selectTPandaOrderLineList(tPandaOrderLine);
    }

    /**
     * 新增子订单明细
     * 
     * @param tPandaOrderLine 子订单明细
     * @return 结果
     */
    @Override
    public int insertTPandaOrderLine(TPandaOrderLine tPandaOrderLine)
    {
        tPandaOrderLine.setCreateTime(DateUtils.getNowDate());
        return tPandaOrderLineMapper.insertTPandaOrderLine(tPandaOrderLine);
    }

    /**
     * 修改子订单明细
     * 
     * @param tPandaOrderLine 子订单明细
     * @return 结果
     */
    @Override
    public int updateTPandaOrderLine(TPandaOrderLine tPandaOrderLine)
    {
        tPandaOrderLine.setUpdateTime(DateUtils.getNowDate());
        return tPandaOrderLineMapper.updateTPandaOrderLine(tPandaOrderLine);
    }

    /**
     * 批量删除子订单明细
     * 
     * @param ids 需要删除的子订单明细ID
     * @return 结果
     */
    @Override
    public int deleteTPandaOrderLineByIds(Long[] ids)
    {
        return tPandaOrderLineMapper.deleteTPandaOrderLineByIds(ids);
    }

    /**
     * 删除子订单明细信息
     * 
     * @param id 子订单明细ID
     * @return 结果
     */
    @Override
    public int deleteTPandaOrderLineById(Long id)
    {
        return tPandaOrderLineMapper.deleteTPandaOrderLineById(id);
    }

    @Override
    public int deleteTPandaOrderLineByTid(String tid) {
        return tPandaOrderLineMapper.deleteTPandaOrderLineByTid(tid);
    }
}
